-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pickling methods to support TorchScript. #74
Conversation
Thank you for doing this! The code looks good but fails the formatting test. Could you run |
Sure! I tried this quickly and it reformatted the entire file, which probably means I did something wrong. I'll look into it shortly. |
Thanks for the PR, @HapeMask! Could you share with us the exact |
Yup, here's some info on what I ran + version:
and this is the changeset it produced for that file: https://gist.github.com/HapeMask/31d530a691b0937344d7392eee8cc0e0 I'm happy to just copy/paste the formatting changes to only the code I added, just let me know. |
I tested clang-format-10 and clang-format-17 on main and they give the exact same results, so I would guess that version is not the issue. From the changelog that @HapeMask sent, it seems that the first indent is 2 spaces, while all others are 4 spaces. It's also reordering the includes (alphabetically) and it seems to dislike long lines. Almost as if it was operating according to a different set of formatting instructions. @Luthaf any ideas? What should we do? |
What happens if you run |
Oh! I don't know how this happened but my clone of your |
Thanks @HapeMask! |
Sphericart already uses
TORCH_LIBRARY
but when serializing the library reference into a TorchScript JIT module, the class needs a pickle/unpickle method as well.